package com.puman.beautyfarmcounselor.ui.schedule.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.puman.beautyfarmcounselor.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Curry on 2015/6/18.
 */
public class DayWeekInfoAdapter extends BaseAdapter {
    private LayoutInflater layoutInflater;

    private List<String> dayWeekInfoList = new ArrayList<String>();

    public final class ViewHolder {
        public TextView dayOfweekIno;
        public RelativeLayout itemLayout;
    }

    public DayWeekInfoAdapter(Context context, List<String> dayWeekInfoList ) {
        this.dayWeekInfoList = dayWeekInfoList;
        layoutInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return dayWeekInfoList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        final ViewHolder viewHolder;
        if (convertView == null) {
            viewHolder = new ViewHolder();
            convertView = layoutInflater.inflate(R.layout.day_week_info, null);
            viewHolder.itemLayout = (RelativeLayout) convertView.findViewById(R.id.dayweek_item_layout);
            viewHolder.dayOfweekIno = (TextView) convertView.findViewById(R.id.dayweek_item_info);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.dayOfweekIno.setText(dayWeekInfoList.get(position));
        return convertView;
    }
}
